package com.lyfei.ydc.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lyfei.ydc.domain.entity.Reservation;
import com.lyfei.ydc.mapper.ReservationMapper;
import org.springframework.stereotype.Service;

@Service("reservationService")
public class ReservationService extends BaseService<ReservationMapper, Reservation> {
    @Override
    public boolean saveOrUpdate(Reservation entity) {

        if(!super.saveOrUpdate(entity)) {
            throw new RuntimeException("预约记录保存失败");
        }


        return true;
    }

    public IPage<Reservation> page(Integer current,Integer size) {
        return this.page(new Page<>(current, size));
    }
}
